/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-20 15:08:50
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-20 16:14:59
 */
import 'package:flutter/material.dart';
import 'package:flutter_data_center/controller/teacher_attendance_controller.dart';
import 'package:flutter_data_center/screens/attendance/teacher/detail/components/week_item.dart';
import 'package:flutter_data_center/utills/color_utils.dart';
import 'package:get/get.dart';

class WeekStatistics extends StatelessWidget {
  const WeekStatistics({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) => GetBuilder<TeacherAttendanceController>(
      builder: (_controller) => Container(
            width: double.infinity,
            height: 161,
            padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
            decoration: BoxDecoration(
              color: Colors.white,
              border: Border.all(
                color: gColor("#FAFAFA"),
              ),
              borderRadius: BorderRadius.circular(10),
            ),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.start,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  "周考勤统计",
                  style: TextStyle(
                    fontSize: 12,
                    color: gColor("#ACACAC"),
                  ),
                ),
                SizedBox(height: 25),
                Expanded(
                  child: ListView.builder(
                      scrollDirection: Axis.horizontal,
                      itemCount: _controller.detail.week.length,
                      itemBuilder: (context, index) =>
                          WeekItem(day: _controller.detail.week[index])),
                ),
              ],
            ),
          ));
}
